package com.wifiscanner;

import android.net.wifi.ScanResult;

public class AccessPoint {
	
	public static boolean isZeroFix(double lat, double lon, double alt) 
	{
		return (lat == 0.0 && lon == 0.0 && alt == 0.0);
	}

	// based on scanresult
	String BSSID;
	String SSID;
	String capabilities;
	int frequency;
	int level;
		
	// based on location
	double lon;
	double lat;
	double alt;
	long timestamp;
		
	// used by db layer
	private boolean inserted = false;

	public AccessPoint(boolean inserted) {
		this.inserted = inserted;
	}

	public AccessPoint() {
		this(false);
	}

	public boolean isInserted() {
		return inserted;
	}

	public void setInserted(boolean inserted) {
		this.inserted = inserted;
	}

	public boolean isZeroFix() {
		return AccessPoint.isZeroFix(this.lat, this.lon, this.alt);
	}
	
	public void setScanResult(ScanResult result) {
		this.BSSID = result.BSSID;
		this.SSID = result.SSID;
		this.capabilities = result.capabilities;
		this.frequency = result.frequency;
		this.level = result.level;
	}
}
